package sc
package test

import scala.io.Source

object test2 {
  def main(args: Array[String]): Unit = {
      val file = Source.fromFile("scala/data/students.csv")
      val list = file.getLines().toList
      val res = list.filter((str :String)=>{
      val sp = str.split(",")
      "文科一班".equals(sp(4))
    }).map((str :String)=>{
      val sp = str.split(",")
      new StringBuffer(sp(0)).append(",").append(sp(1)).append(",").append(sp(4))
    })
    res.foreach(e =>println(e))
  }

}
